<template>
  <div id="index" class="flex between">
    <div class="index-left">
      <img src="@/assets/img/leftBg.png" class="in-bg" />
      <!-- 江西省基本信息 -->
      <div class="le-tit blodFont">
        <img src="@/assets/img/left/tit-bg.png" class="le-tit-bg" />
        江西省基本信息
      </div>
      <div class="le-top-num flex align between wrap">
        <div class="num-item flex">
          <img src="@/assets/img/left/icon1.png" />
          <div class="num-item-div">
            <div class="num-item-div-name">江西面积</div>
            <div class="num-item-div-num blodFont">
              <span>16.69</span>
              万平方公里
            </div>
          </div>
        </div>
        <div class="num-item flex">
          <img src="@/assets/img/left/icon2.png" />
          <div class="num-item-div">
            <div class="num-item-div-name">
              人口数量
              <span>(2024年未常住人口)</span>
            </div>
            <div class="num-item-div-num blodFont">
              <span>4502.01</span>
              万人
            </div>
          </div>
        </div>
        <div class="num-item flex">
          <img src="@/assets/img/left/icon3.png" />
          <div class="num-item-div">
            <div class="num-item-div-name">
              地区生产总值
              <span>(2024年)</span>
            </div>
            <div class="num-item-div-num blodFont">
              <span>34202.5</span>
              亿元
            </div>
          </div>
        </div>
        <div class="num-item flex">
          <img src="@/assets/img/left/icon4.png" />
          <div class="num-item-div">
            <div class="num-item-div-name">森林覆盖率</div>
            <div class="num-item-div-num blodFont">
              <span>63.35%</span>
            </div>
          </div>
        </div>
      </div>
      <!-- 文化特色 -->
      <div class="le-tit blodFont">
        <img src="@/assets/img/left/tit-bg.png" class="le-tit-bg" />
        文化特色
      </div>
      <div class="le-info flex align between wrap">
        <div class="le-info-item">
          <div class="info-i-tit">
            <img src="@/assets/img/left/img1.png" />
            <div>红色文化</div>
          </div>
          <div class="info-i-con">
            <img src="@/assets/img/left/bg2.png" />
            <div>
              江西是中国革命的摇篮，井冈山、瑞金、南昌等地红色旅游资源丰富。
            </div>
          </div>
        </div>
        <div class="le-info-item">
          <div class="info-i-tit">
            <img src="@/assets/img/left/img2.png" />
            <div>陶瓷文化</div>
          </div>
          <div class="info-i-con">
            <img src="@/assets/img/left/bg2.png" />
            <div>景德镇是世界瓷都，陶瓷文化源远流长。</div>
          </div>
        </div>
        <div class="le-info-item">
          <div class="info-i-tit">
            <img src="@/assets/img/left/img3.png" />
            <div>书院文化</div>
          </div>
          <div class="info-i-con">
            <img src="@/assets/img/left/bg2.png" />
            <div>白鹿洞书院、鹅湖书院等是中国古代四大书院之一。</div>
          </div>
        </div>
        <div class="le-info-item">
          <div class="info-i-tit">
            <img src="@/assets/img/left/img4.png" />
            <div>道教文化</div>
          </div>
          <div class="info-i-con">
            <img src="@/assets/img/left/bg2.png" />
            <div>龙虎山是道教发源地之一。</div>
          </div>
        </div>
      </div>
    </div>
    <div class="index-center">
      <div class="flex center cen-nums between">
        <img src="@/assets/img/center/bg.png" class="cen-bg" />
        <div class="nums-item flex center" style="width: 35%">
          <img src="@/assets/img/center/icon1.png" />
          <span class="blodFont">11</span>
          <div>个地级市</div>
        </div>
        <div class="nums-item flex center" style="width: 55%">
          <img src="@/assets/img/center/icon2.png" />
          <span class="blodFont">100</span>
          <div>个县（市、区）</div>
        </div>
      </div>
      <div id="map2"></div>
      <img src="@/assets/img/center/yuan2.png" class="cen-bg">
    </div>
    <div class="index-right">
      <img src="@/assets/img/rightBg.png" class="in-bg" />
      <div class="le-tit blodFont le-tit2">
        <img src="@/assets/img/left/tit-bg.png" class="le-tit-bg" />
        经济与产业
      </div>
      <div class="ri-top">
        <img src="@/assets/img/right/bg.png" class="ri-top-img" />
        <div class="ri-top-tit">
          <img src="@/assets/img/right/bg1.png" />
          <div>农业</div>
        </div>
        <div class="ri-top-con">水稻、茶叶、柑橘、水产</div>
        <div class="ri-top-tit">
          <img src="@/assets/img/right/bg2.png" />
          <div>工业</div>
        </div>
        <div class="ri-top-con">水稻、茶叶、柑橘、水产</div>
        <div class="ri-top-tit">
          <img src="@/assets/img/right/bg2.png" />
          <div>旅游业</div>
        </div>
        <div class="ri-top-con">
          庐山、井冈山、三清山、龙虎山、婺源等景区享誉全国。
        </div>
      </div>
      <div class="le-tit blodFont le-tit2">
        <img src="@/assets/img/left/tit-bg.png" class="le-tit-bg" />
        招商支持
      </div>
      <div class="ri-top ri-bto">
        <img src="@/assets/img/right/bg.png" class="ri-top-img" />
        <div class="ri-bto-item flex align between">
          <img src="@/assets/img/right/icon1.png" />
          <div class="ri-bto-item-con">
            <div>政策支持</div>
            <div>·江西是中部崛起战略的重要省份，国家政策支持。</div>
          </div>
        </div>
        <div class="ri-bto-item flex align between">
          <img src="@/assets/img/right/icon2.png" />
          <div class="ri-bto-item-con">
            <div>区位优势</div>
            <div>·连接长三角、珠三角和闽南经济区，交通便利。</div>
          </div>
        </div>
        <div class="ri-bto-item flex align between">
          <img src="@/assets/img/right/icon3.png" />
          <div class="ri-bto-item-con">
            <div>资源优势</div>
            <div>·矿产资源丰富，生态环境优越。</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { organizationList } from "../api/apiData";
import jiangxi from "@/until/jiangxi2";
// import vueSeamlessScroll from "vue-seamless-scroll";
export default {
  // components: { vueSeamlessScroll },
  data() {
    return {};
  },
  computed: {
    // defaultOption() {
    //   return {
    //     step: 0.2, // 数值越大速度滚动越快
    //     limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
    //     hoverStop: true, // 是否开启鼠标悬停stop
    //     direction: 1, // 0向下 1向上 2向左 3向右
    //     openWatch: true, // 开启数据实时监控刷新dom
    //     singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
    //     singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
    //     waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
    //   };
    // },
  },
  mounted() {
    this.getJiangxi();
  },
  methods: {
    // 跳转江西
    getJiangxi() {
      var that = this;
      let myChart = that.$echarts.init(document.getElementById("map2"));
      that.$echarts.registerMap("江西", jiangxi);
      var d = [];
      for (var i = 0; i < jiangxi.features.length; i++) {
        d.push({ name: jiangxi.features[i].properties.name });
      }
      console.log(d);
      d[7].value = 1000;
      // d[0].value = 2000;
      d[12].value = 3000;
      d[12].name = "进贤";
      d[13].value = 100;
      d[14].value = 200;
      d[18].value = 300;
      d[57].value = 400;
      d[59].value = 500;
      d[90].value = 600;
      // d[21].value = 700;
      d[55].value = 701;
      d[44].value = 702;
      d[41].value = 703;
      d[77].value = 704;
      d[19].value = 709;
      d[87].value = 710;
      d[16].value = 711;
      d[65].value = 712;
      d[81].value = 713;
      d[88].value = 714;
      d[86].value = 715;
      d[39].value = 716;
      // d[50].value = 717;
      // d[48].value = 718;
      d[70].value = 719;
      d[66].value = 720;
      d[68].value = 721;
      d[93].value = 722; //吉州区
      d[94].value = 723; //青原区
      d[95].value = 724; //吉安县
      d[25].value = 725; //瑞昌市
      d[15].value = 726; //濂溪区
      d[17].value = 727; //濂溪区
      d[73].value = 728; //宜丰
      d[56].value = 729; //广昌

      this.renderMap("江西", d);
    },
    renderMap(map, data) {
      var that = this;
      // 散点在地图上的坐标
      var geoCoordMap = {
        南昌市: [115.892151, 28.676493],
      };
      // 将坐标与值对应并反映在地图上
      var convertData = function (data) {
        var res = [];
        for (var i = 0; i < data.length; i++) {
          var geoCoord = geoCoordMap[data[i].name];
          if (geoCoord) {
            res.push({
              name: data[i].name,
              value: geoCoord.concat(data[i].value),
            });
          }
        }
        return res;
      };
      let myChart = that.$echarts.init(document.getElementById("map2"));
      var option = {
        dataRange: {
          x: "-1000 px", //图例横轴位置
          y: "-1000 px", //图例纵轴位置
          splitList: [
            {
              name: "吉州区",
              label: "吉州区",
              value: 1000,
              color: "#928907",
            },
            // {
            //   name: "南昌市",
            //   label: "南昌市",
            //   value: 2000,
            //   color: "#928907",
            // },
            // {
            //   name: "进贤",
            //   label: "进贤",
            //   value: 3000,
            //   color: "#928907",
            // },
            {
              name: "安义县",
              label: "安义县",
              value: 100,
              color: "#928907",
            },
            {
              name: "金溪县",
              label: "金溪县",
              value: 200,
              color: "#928907",
            },
            {
              name: "武宁县",
              label: "武宁县",
              value: 300,
              color: "#928907",
            },
            {
              name: "信州区",
              label: "信州区",
              value: 400,
              color: "#928907",
            },
            {
              name: "广信区",
              label: "广信区",
              value: 500,
              color: "#928907",
            },
            {
              name: "月湖区",
              label: "月湖区",
              value: 600,
              color: "#928907",
            },
            // {
            //   name: "德安县",
            //   label: "德安县",
            //   value: 700,
            //   color: "#928907",
            // },
            {
              name: "资溪县",
              label: "资溪县",
              value: 701,
              color: "#928907",
            },
            {
              name: "瑞金市",
              label: "瑞金市",
              value: 702,
              color: "#928907",
            },
            // {
            //   name: "会昌县",
            //   label: "会昌县",
            //   value: 703,
            //   color: "#928907",
            // },
            {
              name: "樟树市",
              label: "樟树市",
              value: 704,
              color: "#928907",
            },
            {
              name: "吉州区",
              label: "吉州区",
              value: 705,
              color: "#928907",
            },
            {
              name: "青原区",
              label: "青原区",
              value: 706,
              color: "#928907",
            },
            {
              name: "吉安县",
              label: "吉安县",
              value: 707,
              color: "#928907",
            },
            {
              name: "吉水县",
              label: "吉水县",
              value: 708,
              color: "#928907",
            },
            {
              name: "修水县",
              label: "修水县",
              value: 709,
              color: "#928907",
            },
            {
              name: "珠山区",
              label: "珠山区",
              value: 710,
              color: "#928907",
            },
            {
              name: "浔阳区",
              label: "浔阳区",
              value: 711,
              color: "#928907",
            },
            {
              name: "鄱阳县",
              label: "鄱阳县",
              value: 712,
              color: "#928907",
            },
            {
              name: "莲花县",
              label: "莲花县",
              value: 713,
              color: "#928907",
            },
            {
              name: "浮梁县",
              label: "浮梁县",
              value: 714,
              color: "#928907",
            },
            {
              name: "昌江区",
              label: "昌江区",
              value: 715,
              color: "#928907",
            },
            {
              name: "于都县",
              label: "于都县",
              value: 716,
              color: "#928907",
            },
            // {
            //   name: "南丰县",
            //   label: "南丰县",
            //   value: 717,
            //   color: "#928907",
            // },
            // {
            //   name: "南城县",
            //   label: "南城县",
            //   value: 718,
            //   color: "#928907",
            // },
            {
              name: "奉新县",
              label: "奉新县",
              value: 719,
              color: "#928907",
            },
            {
              name: "万年县",
              label: "万年县",
              value: 720,
              color: "#928907",
            },
            {
              name: "德兴市",
              label: "德兴市",
              value: 721,
              color: "#928907",
            },
            {
              name: "瑞昌市",
              label: "瑞昌市",
              value: 725,
              color: "#928907",
            },
            {
              name: "濂溪区",
              label: "濂溪区",
              value: 726,
              color: "#928907",
            },
            {
              name: "柴桑区",
              label: "柴桑区",
              value: 727,
              color: "#928907",
            },
            {
              name: "宜丰县",
              label: "宜丰县",
              value: 728,
              color: "#928907",
            },
            {
              name: "广昌县",
              label: "广昌县",
              value: 729,
              color: "#928907",
            },
          ],
        },
        geo: [{
          map: "江西",
          label: {
            emphasis: {
              show: false,
            },
          },
          itemStyle: {
            normal: {
              areaColor: "",
              borderColor: "#1449d6",
            },
            emphasis: {
              areaColor: "#2a333d",
            },
          },
        },// 重影
          // {
          //   type: 'map',
          //   map: '江西',
          //   zlevel: -1,
          //   // aspectScale: 1,
          //   // zoom: 1.5,
          //   // layoutCenter: ['50%', '64%'],
          //   // layoutSize: '100%',
          //   // roam: false,
          //   // silent: true,
          //   itemStyle: {
          //     borderWidth: 1,
          //     borderColor: 'rgba(58,149,253,0.8)',
          //     shadowColor: 'rgba(172, 122, 255,0.5)',
          //     shadowOffsetY: 5,
          //     shadowBlur: 15,
          //     areaColor: 'rgba(5,21,35,0.1)'
          //   }
          // }
          ],
        animationDuration: 1000,
        animationEasing: "cubicOut",
        animationDurationUpdate: 1000,
      };
      option.series = [
        {
          name: map,
          zoom: 1,
          type: "map",
          mapType: map,
          roam: false,
          nameMap: { china: "江西" },
          label: {
            normal: {
              show: true,
              textStyle: {
                color: "#fff",
                fontSize: 10,
              },
            },
            emphasis: {
              show: true,
              textStyle: { color: "#fff", fontSize: 10 },
            },
          },
          itemStyle: {
            // 每个区域的样式
            normal: {
              areaColor: "#075b9f",
              borderColor: "#4c7db1",
              // borderWidth: 1,
            },
          },
          emphasis: {
            label: {
              show: false,
            },
            itemStyle: {
              areaColor: "#FF7D61",
            },
          },
          data: data,
        },
        // {
        //   type: "effectScatter",
        //   coordinateSystem: "geo",
        //   data: convertData([{ name: "南昌市", value: 1000 }]),
        //   label: {
        //     normal: { show: true, textStyle: { color: "#fff", fontSize: 16 } },
        //     emphasis: {
        //       show: true,
        //       textStyle: { color: "#fff", fontSize: 16 },
        //     },
        //   },
        //   symbolSize: 12,
        //   rippleEffect: {
        //     period: 2.5, //波纹秒数
        //     brushType: "fill", //stroke(涟漪)和fill(扩散)，两种效果
        //     scale: 5, //波纹范围
        //     color: "#FFEE00", // 特效颜色
        //   },
        //   label: {
        //     normal: {
        //       show: false,
        //     },
        //     emphasis: {
        //       show: false,
        //     },
        //   },
        //   itemStyle: {
        //     normal: {
        //       areaColor: "",
        //       borderColor: "#1449d6",
        //       // borderWidth: 1,
        //     },
        //     emphasis: {
        //       borderColor: "#fff",
        //       borderWidth: 1,
        //       color: "#ffffff", // 标志颜色
        //     },
        //   },
        // },
      ];
      myChart.setOption(option);
      myChart.on("click", function (params) {
        if (params.data.value == 3000) {
          // that.toShowInfo(15);
        }
      });
      // //用于使chart自适应高度和宽度
      window.onresize = function () {
        //重置容器高宽
        myChart.resize();
      };
    },
  },
};
</script>
<style lang="less" scoped>
#index {
  padding: 19px 37px;
  .in-bg {
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    height: 100%;
  }
  .le-tit {
    position: relative;
    width: 380px;
    padding: 10px 0 10px 34px;
    font-size: 30px;
    color: white;
    margin-bottom: 30px;
    .le-tit-bg {
      width: 100%;
      position: absolute;
      left: 0;
      top: 0;
      z-index: -1;
      height: 100%;
    }
  }
  .le-tit2 {
    margin-bottom: 14px;
  }
}
.index-left {
  width: 30%;
  padding: 32px 34px;
  position: relative;
  .le-top-num {
    margin-bottom: 40px;
    .num-item {
      margin-bottom: 23px;
      width: 50%;
      img {
        width: 74px;
        height: 76px;
      }
      .num-item-div {
        margin-left: 8px;
        .num-item-div-name {
          color: #6e9ebe;
          font-size: 20px;
          margin-bottom: 11px;
          span {
            font-size: 9px;
          }
        }
        .num-item-div-num {
          font-size: 15px;
          color: white;
        }
        .num-item-div-num span {
          color: #fced10;
          font-size: 30px;
        }
      }
    }
  }
  .le-info {
    .le-info-item {
      // height: 200px;
      width: 46%;
      .info-i-tit {
        position: relative;
        img {
          width: 100%;
        }
        div {
          position: absolute;
          color: white;
          font-size: 22px;
          font-weight: bold;
          top: 20px;
          left: 50px;
          letter-spacing: 2px;
        }
      }
    }
    .info-i-con {
      position: relative;
      width: 100%;
      color: white;
      font-size: 15px;
      padding: 15px 35px;
      letter-spacing: 4px;
      line-height: 1.5;
      top: -20px;
      img {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: -1;
        top: 0;
        left: 0;
      }
    }
  }
}
.index-center {
  width: 37%;
  position: relative;
  .cen-nums {
    position: relative;
    padding: 52px;
    .cen-bg {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      z-index: -1;
    }
    .nums-item {
      justify-content: center;
      font-size: 16.98px;
      color: white;
      img {
        width: 55px;
        height: 64px;
      }
      span {
        color: #fced10;
        font-size: 46px;
        position: relative;
        top: -10px;
      }
    }
  }
  #map2 {
    width: 100%;
    height: 850px;
    position: absolute;
    top: 50px;
  }
  .cen-bg{
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
    z-index: -1;
  }
}
.index-right {
  width: 30%;
  padding: 32px 34px;
  position: relative;
  .ri-top {
    position: relative;
    padding-top: 27px;
    margin-bottom: 25px;
    .ri-top-img {
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: -1;
      top: 0;
      left: 0;
    }
    .ri-top-tit {
      position: relative;
      color: white;
      font-size: 20px;
      padding: 13px 38px 13px 20px;
      width: fit-content;
      font-weight: bold;
      height: auto;
      margin-bottom: 8px;
      letter-spacing: 5px;
      img {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: -1;
        top: 0;
        left: 0;
      }
    }
    .ri-top-con {
      font-size: 15px;
      padding: 0px 20px 22px 20px;
      color: white;
    }
  }
  .ri-bto {
    padding: 20px;
    .ri-bto-item {
      margin-bottom: 20px;
      img {
        width: 44px;
        height: 55px;
      }
      .ri-bto-item-con {
        color: white;
        margin-left: 8px;
        font-size: 18px;
        width: 88%;
      }
      .ri-bto-item-con div:nth-child(1) {
        font-size: 28px;
        font-weight: bold;
        margin-bottom: 2px;
      }
    }
  }
}
</style>
